home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 501-525 / apd503 / daxid_smith / crossword solve.amos / crossword solve.amosSourceCode
AMOS Source Code  |  1986-08-03  |  16KB  |  666 lines

  1. Dim A_CLUE$(30),D_CLUE$(30),A_ANSWER$(30),D_ANSWER$(30),ZX(30),ZY(30),A_ANS$(30),D_ANS$(30),LETTER$(15),A_SOLUTION$(30),D_SOLUTION$(30),A_CRIB$(30),D_CRIB$(30)
  2. '
  3. Global A_CLUE$(),D_CLUE$(),A_ANSWER$(),D_ANSWER$(),ZX(),ZY(),LETTER$(),A_SOLUTION$(),D_SOLUTION$(),A_ANS$(),D_ANS$()
  4. Global A_COUNT,D_COUNT,TXA,TYA,TXD,TYD,ABX,ABY,DBX,DBY,ANSX,ANSY
  5. Global MZA,MZD,LASTMZA,LASTMZD,ANS
  6. Global ANGX,ANGY,F$
  7. '
  8. Cls 0
  9. Hide 
  10. Screen Open 3,640,256,16,Hires
  11. Screen Hide 3
  12. Curs Off : Flash Off 
  13. Gr Writing 0
  14. Paper 0 : Pen 1
  15. Colour 0,$88C
  16. Colour 1,0
  17. Colour 2,$CCF
  18. Colour 3,0
  19. Colour 4,$EEF
  20. '
  21. Colour 5,$558 : Rem___shadow for windows 
  22. Colour 6,$DDF : Rem___highlight for windows
  23. Colour 7,$AAD : Rem___background for windows 
  24. '
  25. Colour 8,$99E : Rem___control buttons
  26. Colour 9,$66B
  27. Colour 10,$337
  28. '
  29. Colour 15,$F70
  30. Colour 17,0
  31. Colour 18,$F00
  32. Colour 19,0
  33. Cls 0
  34. '
  35. Screen Open 1,320,256,32,Lowres
  36. Screen Hide 1
  37. Curs Off : Flash Off 
  38. Load Iff "DWDS_Crossword:extras/Logo.iff"
  39. Screen Show 1
  40. Wait 100
  41. Shift Up 3,2,10,0
  42. Wait 25
  43. Screen Show 3
  44. Screen To Front 3
  45. Screen Close 1
  46.  
  47. Screen Open 2,640,256,16,Hires
  48. Screen Hide 2
  49. Curs Off : Flash Off 
  50. Gr Writing 0
  51. Colour 1,0
  52. Paper 0 : Pen 1
  53. Get Palette 3
  54.  
  55. Screen Open 1,640,256,16,Hires
  56. Curs Off : Flash Off 
  57. Get Palette 3
  58. Cls 0
  59. Screen Hide 1
  60. Screen Show 2
  61. Reserve Zone 47
  62. Gr Writing 0
  63. L1=%11111111
  64. L2=%11111111
  65. L3=%11111111
  66. L4=%11111111
  67. L5=%11111111
  68. L6=%11111111
  69. L7=%11111111
  70. L8=%11111111
  71. Set Curs L1,L2,L3,L4,L5,L6,L7,L8
  72. Limit Mouse 128,42 To 460,296
  73. Pen 1
  74. '
  75. THE_BEGINNING:
  76. Paper 0
  77. Locate ,2 : Centre "D_Solve Crossword  (c)David Smith 1993"
  78. Locate ,4 : Centre "Written and compiled using AMOS Professional"
  79. Locate 3,7 : Centre "INSTRUCTIONS"
  80. Locate 3,9 : Print "1. Load crossword format. Note Format code number must tally with "
  81. Locate 6,10 : Print "solution code number."
  82. Locate 6,11 : Print "Eg. Format 1.iff/Solution 1a.sol"
  83. Locate 3,13 : Print "2. Load solution, selecting correct number code."
  84. Locate 6,14 : Print "Partly completed solutions can be saved, using the standard file"
  85. Locate 6,15 : Print "selector, at any time."
  86. Locate 3,17 : Print "3. Select all buttons, and jotter pad, with left mouse."
  87. Locate 6,18 : Print "Jotter pad notes can be selectively erased by dragging a box"
  88. Locate 6,19 : Print "using right mouse."
  89. Locate 3,21 : Print "4. Select clues using scroll buttons, or by clicking with the"
  90. Locate 6,22 : Print "left mouse on the first across answer square, or right mouse"
  91. Locate 6,23 : Print "on first down answer square."
  92. Locate 3,25 : Print "5. Input answer after clicking in answer box with the left mouse. Press"
  93. Locate 6,26 : Print "<RETURN> to insert answer into crossword. <RETURN> alone will delete a"
  94. Locate 6,27 : Print "wrong answer. Answers can be overwritten by inputting a new answer."
  95. Paper 15
  96. Locate ,29 : Centre " Press <SPACE> to start, <Q> to quit "
  97. Screen Show 1
  98.  
  99. GO:
  100. A$=Inkey$
  101. If A$=" "
  102.    Goto FMATLOAD
  103. End If 
  104. If A$="q"
  105.    Edit 
  106. End If 
  107. Goto GO
  108. '
  109. FMATLOAD:
  110. Show 
  111. Paper 7
  112. FMT$=Fsel$("Format/*.iff","","Load Format")
  113. If FMT$="" : Paper 0 : Goto GO : End If 
  114. Parent 
  115. '
  116. F$=Fsel$("Solution/*.sol","","Load Crossword solution")
  117. If F$="" : Paper 0 : Colour 4,$F00 : Goto GO : End If 
  118. Load Iff FMT$
  119. '
  120. Ink 1
  121. Text 346,161,"Answer"
  122. '
  123. Screen Copy 1 To 3
  124. Open In 1,F$
  125. For S=1 To 30
  126.    Line Input #1,A_ANSWER$(S)
  127.    Line Input #1,D_ANSWER$(S)
  128.    Line Input #1,A_CLUE$(S)
  129.    Line Input #1,D_CLUE$(S)
  130.    Line Input #1,A_SOLUTION$(S)
  131.    Line Input #1,D_SOLUTION$(S)
  132.    Line Input #1,ZX(S)
  133.    Line Input #1,ZY(S)
  134. Next S
  135. Close 1
  136. Parent 
  137. '
  138. Ink 1
  139. Text 10,10,F$
  140. '
  141. For Z=1 To 30
  142.    Set Zone Z,ZX(Z),ZY(Z) To ZX(Z)+18,ZY(Z)+8
  143. Next Z
  144. '
  145. For A=1 To 30
  146.    A_ANS$(A)=A_ANSWER$(A) : Rem___a_ans$ used to compare length of input answer
  147.    D_ANS$(A)=D_ANSWER$(A)
  148. Next A
  149. '
  150. ABX=76 : ABY=176 : Rem___positions to clear boxes for clue text 
  151. DBX=76 : DBY=216
  152. '
  153. CX=9 : CY=173 : Rem___clue box 
  154. ANSX=160 : ANSY=189 : Rem___answer box 
  155. '
  156. For B=1 To 3 Step 2
  157.    Set Zone B+43,CX+62,CY To CX+620,CY+13 : Rem___zones 44 and 46
  158.    Set Zone B+39,CX,CY+16 To CX+58,CY+29 : Rem___zones 40 and 42
  159.    Set Zone B+40,CX+62,CY+16 To CX+120,CY+29 : Rem___zones 41 and 43
  160.    Add CY,40
  161. Next B
  162. '
  163. For B=37 To 38
  164.    Set Zone B,ANSX,ANSY To ANSX+470,ANSY+13
  165.    Add ANSY,40
  166. Next B
  167. ANSY=189 : Rem___reset answer box coordinate
  168. '
  169. TXA=80 : TYA=182 : Rem___across text position 
  170. TXD=80 : TYD=222
  171. '
  172. A_COUNT=1
  173. While A_CLUE$(A_COUNT)="" : Rem___find first across answer 
  174.    Add A_COUNT,1
  175. Wend 
  176. D_COUNT=1
  177. While D_CLUE$(D_COUNT)="" : Rem___find first down answer 
  178.    Add D_COUNT,1
  179. Wend 
  180. '
  181. MZA=A_COUNT : MZD=D_COUNT : Rem___numbers used for highlighting squares
  182. '
  183. PICK_SQUARES_ACROSS
  184. PICK_SQUARES_DOWN
  185. '
  186. Text TXA,TYA,Str$(A_COUNT)+" "+A_CLUE$(A_COUNT)
  187. Text TXD,TYD,Str$(D_COUNT)+" "+D_CLUE$(D_COUNT)
  188. '
  189. QX=320 : QY=14 : Rem___quit box 
  190. For I=31 To 33
  191.    Set Zone I,QX,QY To QX+95,QY+15
  192.    Add QX,107
  193. Next I
  194. '
  195. ANGX=320 : ANGY=41 : Rem___anagram box
  196. Set Zone 34,ANGX,ANGY To ANGX+310,ANGY+105
  197. Set Zone 35,ANGX+107,ANGY+110 To ANGX+202,ANGY+125
  198. Set Zone 36,ANGX+214,ANGY+110 To ANGX+310,ANGY+125
  199. Set Zone 47,ANGX,ANGY+110 To ANGX+95,ANGY+125
  200. '
  201. MAIN_LOOP:
  202. Paper 7
  203. Do 
  204.    If Mouse Key=1 and Mouse Zone<31 : Rem___crossword squares
  205.       If Mouse Zone>0
  206.          MZA=Mouse Zone
  207.          A_COUNT=MZA
  208.          If A_CLUE$(MZA)="" : Rem___force selection of across squares
  209.             Goto MAIN_LOOP
  210.          End If 
  211.          While Mouse Key=1 : Wend 
  212.          Ink 7 : Bar ABX,ABY To ABX+550,ABY+8
  213.          Ink 1
  214.          Text TXA,TYA,Str$(MZA)+" "+A_CLUE$(MZA)
  215.          PICK_SQUARES_ACROSS
  216.       End If 
  217.    End If 
  218.    If Mouse Key=2 and Mouse Zone<31 : Rem___crossword squares
  219.       If Mouse Zone>0
  220.          MZD=Mouse Zone
  221.          D_COUNT=MZD
  222.          If D_CLUE$(MZD)="" : Rem___force selection of down squares
  223.             Goto MAIN_LOOP
  224.          End If 
  225.          While Mouse Key=2 : Wend 
  226.          Ink 7 : Bar DBX,DBY To DBX+550,DBY+8
  227.          Ink 1
  228.          Text TXD,TYD,Str$(MZD)+" "+D_CLUE$(MZD)
  229.          PICK_SQUARES_DOWN
  230.       End If 
  231.    End If 
  232.    '
  233.    If Mouse Key=1 and Mouse Zone=31
  234.       While Mouse Key=1
  235.          Ink 4
  236.          Text 350,QY+10,"Quit"
  237.       Wend 
  238.       Ink 1
  239.       Text 350,QY+10,"Quit"
  240.       Edit 
  241.    End If 
  242.    '
  243.    If Mouse Key=1 and Mouse Zone=32 : Rem___save 
  244.       While Mouse Key=1
  245.          Ink 4
  246.          Text 457,QY+10,"Save"
  247.       Wend 
  248.       Ink 1
  249.       Text 457,QY+10,"Save"
  250.       CROSSWORD_SAVE
  251.    End If 
  252.    If Mouse Key=1 and Mouse Zone=33 : Rem___clear
  253.       While Mouse Key=1
  254.          Ink 4
  255.          Text 560,QY+10,"Clear"
  256.       Wend 
  257.       Ink 1
  258.       Text 560,QY+10,"Clear"
  259.       Cls 0
  260.       Goto THE_BEGINNING
  261.    End If 
  262.    '
  263.    If Mouse Key=1 and Mouse Zone=34
  264.       ANAGRAM
  265.    End If 
  266.    '
  267.    If Mouse Key=1 and Mouse Zone=35 : Rem___clear anagram box
  268.       While Mouse Key=1
  269.          Ink 4
  270.          Text 440,161,"Clear pad"
  271.       Wend 
  272.       Ink 1
  273.       Text 440,161,"Clear pad"
  274.       Ink 7
  275.       Bar ANGX+4,ANGY+3 To ANGX+307,ANGY+103
  276.       Ink 1
  277.    End If 
  278.    '
  279.    If Mouse Key=1 and Mouse Zone=37 : Rem___across answer
  280.       ANSWER_ACROSS
  281.    End If 
  282.    If Mouse Key=1 and Mouse Zone=38 : Rem___down answer
  283.       ANSWER_DOWN
  284.    End If 
  285.    If Mouse Key=1 and Mouse Zone=40 : Rem___across/up
  286.       While Mouse Key=1
  287.          Ink 4 : Polyline 24,199 To 54,199 To 39,192 To 24,199
  288.       Wend 
  289.       Ink 1 : Polyline 24,199 To 54,199 To 39,192 To 24,199
  290.       ACROSS_SCROLL_UP
  291.       MZA=A_COUNT
  292.       PICK_SQUARES_ACROSS
  293.    End If 
  294.    If Mouse Key=1 and Mouse Zone=41 : Rem___across/down
  295.       While Mouse Key=1
  296.          Ink 4
  297.          Polyline 86,192 To 116,192 To 101,199 To 86,192
  298.       Wend 
  299.       Ink 1
  300.       Polyline 86,192 To 116,192 To 101,199 To 86,192
  301.       ACROSS_SCROLL_DOWN
  302.       MZA=A_COUNT
  303.       PICK_SQUARES_ACROSS
  304.    End If 
  305.    If Mouse Key=1 and Mouse Zone=42 : Rem___down/up
  306.       While Mouse Key=1
  307.          Ink 4 : Polyline 24,239 To 54,239 To 39,232 To 24,239
  308.       Wend 
  309.       Ink 1 : Polyline 24,239 To 54,239 To 39,232 To 24,239
  310.       D_OWN_SCROLL_UP
  311.       MZD=D_COUNT
  312.       PICK_SQUARES_DOWN
  313.    End If 
  314.    If Mouse Key=1 and Mouse Zone=43 : Rem___down/down
  315.       While Mouse Key=1
  316.          Ink 4
  317.          Polyline 86,232 To 116,232 To 101,239 To 86,232
  318.       Wend 
  319.       Ink 1
  320.       Polyline 86,232 To 116,232 To 101,239 To 86,232
  321.       D_OWN_SCROLL_DOWN
  322.       MZD=D_COUNT
  323.       PICK_SQUARES_DOWN
  324.    End If 
  325.    If Mouse Key=1 and Mouse Zone=47 : Rem___answer 
  326.       While Mouse Key=1
  327.          Ink 4
  328.          Text 346,161,"Answer"
  329.       Wend 
  330.       Ink 1
  331.       Text 346,161,"Answer"
  332.       Ink 7
  333.       Bar ANGX+4,ANGY+2 To ANGX+307,ANGY+103
  334.       CRIB
  335.    End If 
  336. Loop 
  337. '
  338. Procedure ACROSS_SCROLL_UP
  339.    Add A_COUNT,-1
  340.    If A_COUNT<1 : A_COUNT=30 : End If 
  341.    While A_CLUE$(A_COUNT)=""
  342.       Add A_COUNT,-1
  343.       If A_COUNT<1 : A_COUNT=30 : End If 
  344.    Wend 
  345.    Ink 7 : Bar ABX,ABY To ABX+550,ABY+8
  346.    Ink 1
  347.    Text TXA,TYA,Str$(A_COUNT)+" "+A_CLUE$(A_COUNT)
  348.    Wait 10
  349. End Proc
  350. '
  351. Procedure ACROSS_SCROLL_DOWN
  352.    Add A_COUNT,1
  353.    If A_COUNT>30 : A_COUNT=1 : End If 
  354.    While A_CLUE$(A_COUNT)=""
  355.       Add A_COUNT,1
  356.       If A_COUNT>30 : A_COUNT=1 : End If 
  357.    Wend 
  358.    Ink 7 : Bar ABX,ABY To ABX+550,ABY+8
  359.    Ink 1
  360.    Text TXA,TYA,Str$(A_COUNT)+" "+A_CLUE$(A_COUNT)
  361.    Wait 10
  362. End Proc
  363. '
  364. Procedure D_OWN_SCROLL_UP
  365.    Add D_COUNT,-1
  366.    If D_COUNT<1 : D_COUNT=30 : End If 
  367.    While D_CLUE$(D_COUNT)=""
  368.       Add D_COUNT,-1
  369.       If D_COUNT<1 : D_COUNT=30 : End If 
  370.    Wend 
  371.    Ink 7 : Bar DBX,DBY To DBX+550,DBY+8
  372.    Ink 1
  373.    Text TXD,TYD,Str$(D_COUNT)+" "+D_CLUE$(D_COUNT)
  374.    Wait 10
  375. End Proc
  376. '
  377. Procedure D_OWN_SCROLL_DOWN
  378.    Add D_COUNT,1
  379.    If D_COUNT>30 : D_COUNT=1 : End If 
  380.    While D_CLUE$(D_COUNT)=""
  381.       Add D_COUNT,1
  382.       If D_COUNT>30 : D_COUNT=1 : End If 
  383.    Wend 
  384.    Ink 7 : Bar DBX,DBY To DBX+550,DBY+8
  385.    Ink 1
  386.    Text TXD,TYD,Str$(D_COUNT)+" "+D_CLUE$(D_COUNT)
  387.    Wait 10
  388. End Proc
  389. '
  390. Procedure PICK_SQUARES_ACROSS
  391.    '
  392.    'routine to turn off last across and down highlighting 
  393.    '
  394.    Screen 3
  395.    If LASTMZA>0
  396.       L=Len(A_ANS$(LASTMZA))
  397.       HX=ZX(LASTMZA) : HY=ZY(LASTMZA)
  398.       For H=1 To L
  399.          Ink 2 : Bar HX,HY To HX+18,HY+8
  400.          Add HX,20
  401.       Next H
  402.    End If 
  403.    '
  404.    L=Len(A_ANS$(MZA)) : Rem___highlight current across squares   
  405.    HX=ZX(MZA) : HY=ZY(MZA)
  406.    For H=1 To L
  407.       Ink 4 : Bar HX,HY To HX+18,HY+8
  408.       Add HX,20
  409.    Next H
  410.    '
  411.    If LASTMZD>0
  412.       L=Len(D_ANS$(LASTMZD)) : Rem___highlight current down squares   
  413.       HX=ZX(LASTMZD) : HY=ZY(LASTMZD)
  414.       For H=1 To L
  415.          Ink 4 : Bar HX,HY To HX+18,HY+8
  416.          Add HY,10
  417.       Next H
  418.    End If 
  419.    LASTMZA=MZA
  420.    REDRAW
  421. End Proc
  422. '
  423. Procedure PICK_SQUARES_DOWN
  424.    '
  425.    'routine to turn off last across and down highlighting 
  426.    '
  427.    Screen 3
  428.    If LASTMZD>0
  429.       L=Len(D_ANS$(LASTMZD))
  430.       HX=ZX(LASTMZD) : HY=ZY(LASTMZD)
  431.       For H=1 To L
  432.          Ink 2 : Bar HX,HY To HX+18,HY+8
  433.          Add HY,10
  434.       Next H
  435.    End If 
  436.    '
  437.    L=Len(D_ANS$(MZD)) : Rem___highlight current down squares   
  438.    HX=ZX(MZD) : HY=ZY(MZD)
  439.    For H=1 To L
  440.       Ink 4 : Bar HX,HY To HX+18,HY+8
  441.       Add HY,10
  442.    Next H
  443.    '
  444.    If LASTMZA>0
  445.       L=Len(A_ANS$(LASTMZA)) : Rem___highlight current across squares   
  446.       HX=ZX(LASTMZA) : HY=ZY(LASTMZA)
  447.       For H=1 To L
  448.          Ink 4 : Bar HX,HY To HX+18,HY+8
  449.          Add HX,20
  450.       Next H
  451.    End If 
  452.    '
  453.    LASTMZD=MZD
  454.    REDRAW
  455. End Proc
  456. '
  457. Procedure ANSWER_ACROSS
  458.    TYPE_IN:
  459.    Clear Key 
  460.    Ink 4 : Bar ANSX+5,ANSY+2 To ANSX+466,ANSY+11
  461.    Paper 4
  462.    Locate 22,24 : Line Input A_ANSWER$(A_COUNT)
  463.    Curs Off 
  464.    L=Len(A_ANS$(MZA)) : Rem___highlight current across squares   
  465.    If A_ANSWER$(A_COUNT)=""
  466.       A_ANSWER$(A_COUNT)=Space$(L) : Rem___reset ANSWER 
  467.       Goto HIGHLIGHT
  468.    End If 
  469.    If Len(A_ANSWER$(A_COUNT))>Len(A_ANS$(MZA))
  470.       Locate 22,24 : Print "Too many letters - try again"
  471.       Wait 50
  472.       Ink 7 : Bar ANSX+5,ANSY+2 To ANSX+466,ANSY+11
  473.       Goto TYPE_IN
  474.    End If 
  475.    If Len(A_ANSWER$(A_COUNT))<Len(A_ANS$(MZA))
  476.       Locate 22,24 : Print "Not enough letters - try again"
  477.       Wait 50
  478.       Ink 7 : Bar ANSX+5,ANSY+2 To ANSX+466,ANSY+11
  479.       Goto TYPE_IN
  480.    End If 
  481.    HIGHLIGHT:
  482.    Screen 3
  483.    HX=ZX(MZA) : HY=ZY(MZA)
  484.    For H=1 To L
  485.       Ink 4 : Bar HX,HY To HX+18,HY+8
  486.       Add HX,20
  487.    Next H
  488.    Screen 1
  489.    Paper 7
  490.    Ink 7 : Bar ANSX+5,ANSY+2 To ANSX+466,ANSY+11
  491.    REDRAW
  492. End Proc
  493. '
  494. Procedure ANSWER_DOWN
  495.    TYPE_IN:
  496.    Clear Key 
  497.    Paper 4
  498.    Ink 4 : Bar ANSX+5,ANSY+42 To ANSX+466,ANSY+51
  499.    Locate 22,29 : Line Input D_ANSWER$(D_COUNT)
  500.    Curs Off 
  501.    L=Len(D_ANS$(MZD)) : Rem___highlight current down squares   
  502.    If D_ANSWER$(D_COUNT)=""
  503.       D_ANSWER$(D_COUNT)=Space$(L) : Rem___reset ANSWER 
  504.       Goto HIGHLIGHT
  505.    End If 
  506.    If Len(D_ANSWER$(D_COUNT))>Len(D_ANS$(MZD))
  507.       Locate 22,29 : Print "Too many letters - try again"
  508.       Wait 50
  509.       Ink 7 : Bar ANSX+5,ANSY+42 To ANSX+466,ANSY+51
  510.       Goto TYPE_IN
  511.    End If 
  512.    If Len(D_ANSWER$(D_COUNT))<Len(D_ANS$(MZD))
  513.       Locate 22,29 : Print "Not enough letters - try again"
  514.       Wait 50
  515.       Ink 7 : Bar ANSX+5,ANSY+42 To ANSX+466,ANSY+51
  516.       Goto TYPE_IN
  517.    End If 
  518.    HIGHLIGHT:
  519.    Screen 3
  520.    HX=ZX(MZD) : HY=ZY(MZD)
  521.    For H=1 To L
  522.       Ink 4 : Bar HX,HY To HX+18,HY+8
  523.       Add HY,10
  524.    Next H
  525.    Screen 1
  526.    Paper 7
  527.    Ink 7 : Bar ANSX+5,ANSY+42 To ANSX+466,ANSY+51
  528.    REDRAW
  529. End Proc
  530. '
  531. Procedure REDRAW
  532. Screen Copy 3 To 2
  533. Screen 2
  534.    For A=1 To 30
  535.       L=Len(A_ANSWER$(A))
  536.       XA=ZX(A)
  537.       For B=1 To L
  538.          LETTER$(B)=Mid$(A_ANSWER$(A),B,1)
  539.          Ink 1
  540.          Text XA+6,ZY(A)+7,Upper$(LETTER$(B))
  541.          Add XA,20
  542.       Next B
  543.    Next A
  544.    For D=1 To 30
  545.       L=Len(D_ANSWER$(D))
  546.       YD=ZY(D)
  547.       For B=1 To L
  548.          LETTER$(B)=Mid$(D_ANSWER$(D),B,1)
  549.          Ink 1
  550.          Text ZX(D)+6,YD+7,Upper$(LETTER$(B))
  551.          Add YD,10
  552.       Next B
  553.    Next D
  554.    Screen Copy 2,10,15,310,165 To 1,10,15
  555.    Screen 1
  556. End Proc
  557. '
  558. Procedure CROSSWORD_SAVE
  559.    F$=Fsel$("Solution/*.sol","","Save CURRENT solution (use .sol extension)")
  560.    If F$="" : Pop Proc : End If 
  561.    Open Out 1,F$
  562.    For S=1 To 30
  563.       Print #1,A_ANSWER$(S)
  564.       Print #1,D_ANSWER$(S)
  565.       Print #1,A_CLUE$(S)
  566.       Print #1,D_CLUE$(S)
  567.       Print #1,A_SOLUTION$(S)
  568.       Print #1,D_SOLUTION$(S)
  569.       Print #1,ZX(S)
  570.       Print #1,ZY(S)
  571.    Next S
  572.    Close 1
  573.    Parent 
  574.    Cls 0,0,0 To 640,14
  575.    Ink 1
  576.    Text 10,10,F$
  577. End Proc
  578. '
  579. Procedure ANAGRAM
  580.    LX=X Screen(X Mouse) : LY=Y Screen(Y Mouse)
  581.    Limit Mouse 290,84 To 441,207
  582.    ANAGRAM:
  583.    A$=Inkey$
  584.    If Mouse Key=2
  585.       Limit Mouse 290,85 To 441,186
  586.       Wait 5
  587.       RUBBERBOX:
  588.       Gr Writing 2
  589.       EX=X Screen(X Mouse) : EY=Y Screen(Y Mouse)
  590.       FX=EX : FY=EY
  591.       Repeat 
  592.          Box EX,EY To FX,FY
  593.          FX=X Screen(X Mouse) : FY=Y Screen(Y Mouse)
  594.          Box EX,EY To FX,FY
  595.       Until Mouse Key=0
  596.       If EX=FX or EY=FY
  597.          Goto RUBBERBOX
  598.       End If 
  599.       If EX>FX
  600.          GX=FX : HX=EX
  601.       Else GX=EX : HX=FX
  602.       End If 
  603.       If EY>FY
  604.          GY=FY : HY=EY
  605.       Else GY=EY : HY=FY
  606.       End If 
  607.       Gr Writing 0
  608.       Ink 7 : Bar GX,GY To HX,HY
  609.       Limit Mouse 290,84 To 441,207
  610.    End If 
  611.    If Mouse Key=1 and Mouse Zone=34
  612.       If X Screen(X Mouse)>330 and X Screen(X Mouse)<620
  613.          If Y Screen(Y Mouse)>50 and Y Screen(Y Mouse)<140
  614.             LX=X Screen(X Mouse) : LY=Y Screen(Y Mouse)
  615.          End If 
  616.       End If 
  617.    End If 
  618.    If Mouse Key=1 and Mouse Zone=35 : Rem___clear anagram box
  619.       While Mouse Key=1
  620.          Ink 4
  621.          Text 440,161,"Clear pad"
  622.       Wend 
  623.       Ink 1
  624.       Text 440,161,"Clear pad"
  625.       Ink 7
  626.       Bar ANGX+4,ANGY+3 To ANGX+307,ANGY+103
  627.       Ink 1
  628.    End If 
  629.    If Mouse Key=1 and Mouse Zone=36 : Rem___exit 
  630.       While Mouse Key=1
  631.          Ink 4
  632.          Text 548,161,"Exit pad"
  633.       Wend 
  634.       Ink 1
  635.       Text 548,161,"Exit pad"
  636.       Limit Mouse 128,42 To 460,296
  637.       Pop Proc
  638.    End If 
  639.    If A$>Chr$(31)
  640.       Ink 1
  641.       If LX>620
  642.          Goto ANAGRAM
  643.       End If 
  644.       Text LX,LY,A$
  645.       Add LX,12
  646.    End If 
  647.    Goto ANAGRAM
  648. End Proc
  649. '
  650. Procedure CRIB
  651.    Ink 7
  652.    Bar ANGX+4,ANGY+3 To ANGX+307,ANGY+103
  653.    Pen 1 : Paper 7
  654.    If MZA>9
  655.       Locate 42,6
  656.    Else 
  657.       Locate 43,6
  658.    End If 
  659.    Print Str$(MZA)+" Across  "+Upper$(A_SOLUTION$(MZA))
  660.    If MZD>9
  661.       Locate 42,8
  662.    Else 
  663.       Locate 43,8
  664.    End If 
  665.    Print Str$(MZD)+" Down    "+Upper$(D_SOLUTION$(MZD))
  666. End Proc